package com.ruoyi.fun.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fun.mapper.EcMiniprogramConfigMapper;
import com.ruoyi.fun.domain.EcMiniprogramConfig;
import com.ruoyi.fun.service.IEcMiniprogramConfigService;

/**
 * 小程序配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-31
 */
@Service
public class EcMiniprogramConfigServiceImpl implements IEcMiniprogramConfigService 
{
    @Autowired
    private EcMiniprogramConfigMapper ecMiniprogramConfigMapper;

    /**
     * 查询小程序配置
     * 
     * @param configId 小程序配置主键
     * @return 小程序配置
     */
    @Override
    public EcMiniprogramConfig selectEcMiniprogramConfigByConfigId(Long configId)
    {
        return ecMiniprogramConfigMapper.selectEcMiniprogramConfigByConfigId(configId);
    }

    /**
     * 查询小程序配置列表
     * 
     * @param ecMiniprogramConfig 小程序配置
     * @return 小程序配置
     */
    @Override
    public List<EcMiniprogramConfig> selectEcMiniprogramConfigList(EcMiniprogramConfig ecMiniprogramConfig)
    {
        return ecMiniprogramConfigMapper.selectEcMiniprogramConfigList(ecMiniprogramConfig);
    }

    /**
     * 新增小程序配置
     * 
     * @param ecMiniprogramConfig 小程序配置
     * @return 结果
     */
    @Override
    public int insertEcMiniprogramConfig(EcMiniprogramConfig ecMiniprogramConfig)
    {
        ecMiniprogramConfig.setCreateTime(DateUtils.getNowDate());
        return ecMiniprogramConfigMapper.insertEcMiniprogramConfig(ecMiniprogramConfig);
    }

    /**
     * 修改小程序配置
     * 
     * @param ecMiniprogramConfig 小程序配置
     * @return 结果
     */
    @Override
    public int updateEcMiniprogramConfig(EcMiniprogramConfig ecMiniprogramConfig)
    {
        ecMiniprogramConfig.setUpdateTime(DateUtils.getNowDate());
        return ecMiniprogramConfigMapper.updateEcMiniprogramConfig(ecMiniprogramConfig);
    }

    /**
     * 批量删除小程序配置
     * 
     * @param configIds 需要删除的小程序配置主键
     * @return 结果
     */
    @Override
    public int deleteEcMiniprogramConfigByConfigIds(Long[] configIds)
    {
        return ecMiniprogramConfigMapper.deleteEcMiniprogramConfigByConfigIds(configIds);
    }

    /**
     * 删除小程序配置信息
     * 
     * @param configId 小程序配置主键
     * @return 结果
     */
    @Override
    public int deleteEcMiniprogramConfigByConfigId(Long configId)
    {
        return ecMiniprogramConfigMapper.deleteEcMiniprogramConfigByConfigId(configId);
    }
}
